package models;

import controllers.MobController;


public class Position {
	
	private Integer positionX;
	private Integer positionY;
	
	public Position(Integer x, Integer y) {
		this.positionX = x;
		this.positionY = y;
	}
	
	public Position() {
		this.positionX = 2;
		this.positionY = 0;
	}
	
	public Integer getPositionX() {
		return positionX;
	}
	
	public void setPositionX(Integer positionX) {
		this.positionX = positionX;
	}
	
	public Integer getPositionY() {
		return positionY;
	}
	
	public void setPositionY(Integer positionY) {
		this.positionY = positionY;
	}
	
	public void incPositionX() {
		this.positionX++;
	}
	
	public void incPositionY() {
		this.positionY++;
	}
	
	public void decPositionY() {
		this.positionY--;
	}
	
	public void decPositionX() {
		this.positionX--;
	}
	
	@Override
	public String toString() {
		return "a posicao eh " + positionX + positionY;
	}
	
	public Boolean isValidFreePosition(Map map) {
		return (positionX>0 && positionY>0 && map.getMapPosition(positionX, positionY) == MobController.MOB_FREE_PATH);
	}
}
